package com.smarthospital.web.configuration;

import com.smarthospital.dao.daoService.CommonDaoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.io.IOException;

/**
 * create by sym  2021/4/14 23:26.
 */
@Slf4j
@Component
public class InitJob {

    @Autowired
    private CommonDaoService commonDaoService;

//    @PostConstruct
    public void init() throws IOException {

        commonDaoService.initSql();
    }
//
//    public static void main (String[] args) throws Exception{
//        log.info(" bb  开始");
//        InputStream is = InitJob.class.getClassLoader().getResourceAsStream("application.yml");
//        File file = new File("g:\\demo\\bb.yml");
//        OutputStream os = new FileOutputStream("g:\\demo\\bb.yml");
//        while (is.available() ==0) {
//            byte[] bytes = new byte[1024];
//            is.read(bytes);
//            os.write(bytes);
//        }
//        is.close();
//        os.flush();
//        os.close();
//    }

}
